# 找到所有七位数的回文素数
def is_prime(n):
    if n < 2:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


def is_palindrome(n):
    s = str(n)
    return s == s[::-1]


def main():
    for a in range(1, 10):
        for b in range(0, 10):
            for c in range(0, 10):
                for d in range (0,10):
                    n = a*1000000+b*100000+c*10000+d*1000+c*100+b*10+a    
                if is_prime(n):
                    print(n)


if __name__ == '__main__':
    main()
